home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-08-18 | 517 b | 29 lines | [TEXT/R*ch] |
- (* Process *)
-
- type status = int
-
- val success : status = 0;
- val failure : status = ~1;
-
- prim_val system : string -> status = 1 "sml_system";
-
- local
- prim_val getenv_ : string -> string = 1 "sys_getenv";
- in
- fun getEnv s =
- (SOME (getenv_ s)) handle _ => NONE
- end
-
- val terminate = BasicIO.exit;
-
- local
- val exittasks = (ref []) : (unit -> unit) list ref
- in
- fun atExit newtask =
- exittasks := newtask :: !exittasks;
- fun exit status =
- (List.app (fn f => f ()) (!exittasks);
- terminate status);
- end
-
-